import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../values/values.dart';

class AppTheme {
  static const horizontalMargin = 16.0;
  static const radius = 10.0;

  static ThemeData dark = ThemeData(
    fontFamily: 'Poppins',
    brightness: Brightness.light,
    scaffoldBackgroundColor: AppColors.scaffoldBackground,
    splashColor: Colors.transparent,
    splashFactory: NoSplash.splashFactory,
    highlightColor: Colors.transparent,
    primaryColor: AppColors.scaffoldBackground,
    colorScheme: ColorScheme.fromSwatch().copyWith(
      secondary: AppColors.accentColor,
    ),
    textTheme: TextTheme(
      // 相当于Compose中的displayLarge
      displayLarge: TextStyle(fontSize: 57.sp, color: AppColors.primaryText),
      // 默认大标题
      headlineLarge: TextStyle(fontSize: 34.sp, color: AppColors.primaryText),
      // 默认中等标题
      headlineMedium: TextStyle(fontSize: 28.sp, color: AppColors.primaryText),
      // 默认小标题
      headlineSmall: TextStyle(fontSize: 24.sp, color: AppColors.primaryText),
      // 标题
      titleLarge: TextStyle(fontSize: 22.sp, color: AppColors.primaryText),
      // 中等标题
      titleMedium: TextStyle(fontSize: 18.sp, color: AppColors.primaryText),
      // 小标题
      titleSmall: TextStyle(fontSize: 16.sp, color: AppColors.primaryText),
      // 大型正文
      bodyLarge: TextStyle(fontSize: 16.sp, color: AppColors.primaryText),
      // 正文
      bodyMedium: TextStyle(fontSize: 14.sp, color: AppColors.primaryText),
      // 小型正文
      bodySmall: TextStyle(fontSize: 12.sp, color: AppColors.primaryText),
      // 大标签
      labelLarge: TextStyle(fontSize: 14.sp, color: AppColors.primaryText),
      // 中等标签
      labelMedium: TextStyle(fontSize: 12.sp, color: AppColors.primaryText),
      // 小标签
      labelSmall: TextStyle(fontSize: 11.sp, color: AppColors.primaryText),
    ),
    appBarTheme: AppBarTheme(
      elevation: 0,
      centerTitle: true,
      backgroundColor: AppColors.scaffoldBackground,
      iconTheme: const IconThemeData(
        color: AppColors.primaryText,
      ),
      titleTextStyle: TextStyle(
        fontSize: 18.sp,
        color: AppColors.primaryText,
      ),
      toolbarTextStyle: TextStyle(
        fontSize: 18.sp,
        color: AppColors.primaryText,
      ),
    ),
    bottomNavigationBarTheme: const BottomNavigationBarThemeData(
      backgroundColor: AppColors.scaffoldBackground,
      unselectedLabelStyle: TextStyle(fontSize: 12),
      selectedLabelStyle: TextStyle(fontSize: 12),
      unselectedItemColor: Color(0xffA2A5B9),
      selectedItemColor: AppColors.accentColor,
    ),
    tabBarTheme: const TabBarTheme(
      indicatorSize: TabBarIndicatorSize.label,
      labelColor: AppColors.accentColor,
      unselectedLabelColor: AppColors.secondaryText,
    ),
  );
}
